<extend name="Public:template" />
<block name="page_header">
</block>
<block name="page_body">
<!-- 购物车页面  -->
<header class="headerSub clearfix">
    <h2>客户登录</h2>
    <a href="#" class="backBtn leftBtn" onClick="javascript:window.history.back(-1);return false;">返回上页</a>
    <a href="{:U('CustPassport/showRegist')}" class="rightBtn yellowNorBg">马上注册</a>
</header>
<div class="content">
	<form action="{:U('CustPassport/doLogin')}" method="post" id="form_edit" name="form_edit">
		<input type="hidden" name="lastUrl" value="{$lastUrl}">
		<div class="loginFrame">
			<ul>
				<li>
					<p id="err_info" class="errHolder" style="display:none;"></p>
					<p class="inputBox">
						<i class="inputDesc descIcon iconUser"></i>
						<input id="cust_account" name="cust_account" type="text" class="default" placeholder="请输入手机号码" />
					</p>
				</li>
				<li>
					<p class="inputBox">
						<i class="inputDesc descIcon iconPwd"></i>
						<input id="cust_pass" name="cust_pass" type="password" class="default" placeholder="请输入密码"/>
					</p>
				</li>
			</ul>
			<p><label><input id="J_auth" name="keepLogin" type="checkbox"  class="iconCheckbox" checked="checked"/>一个月之内免登录</label></p>
			<ul class="linkBtnBox">
				<li class="linkBtnBoxFull"><a href="#" id="doLoginBtn" class="linkBtn greenNorBg" >立即登录</a></li>
			</ul>
		</div>

	</form>
</div>
</block>
<block name="script_footer">
<script type="text/javascript">
$(document).ready(function(){
	$("#doLoginBtn").on( "click", function(e) {
		$("#err_info").hide();
		$.ajax({
	        'url': $("#form_edit").attr("action"),
	        'type':"post",
	        'dataType': "json",
	        'data': $('#form_edit').serialize(),
	        'success': function (data) {
	        	var error = data['error'];
	        	var message = data['message'];
	        	$("#err_info").html(message);
        		$("#err_info").show();
	        	if(error=='0'){
	        		var lastUrl = document.forms['form_edit'].lastUrl.value;
	        		document.location.href="{:U('jumpLastUrl')}?lastUrl="+lastUrl;
	        	}
	        }
	    });
	});
})
</script>
</block>